<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
</head>
<body>

<div th:if="${userList==null || #lists.size(userList) == 0}">
    用户列表为空！
</div>

<a th:href="@{/toUserAddPage}">添加用户</a>
<div th:unless="${userList==null || #lists.size(userList) == 0}">
    <table border="1px" rules="all" cellpadding="10px" cellspacing="0px" width="400px" height="300px">
        <tr>
            <td>编号</td>
            <td>账户</td>
            <td>密码</td>
            <td>金额</td>
            <td>操作</td>
        </tr>

        <tr th:each="user : ${userList}">
            <td th:text="${user.userid}">编号</td>
            <td th:text="${user.username}">账户</td>
            <td th:text="${user.password}">密码</td>
            <td th:text="${user.money}">金额</td>
            <td>
                <!--http://localhost:8080/framework12/deleteUserById?userid=1-->
                <a th:href="@{/deleteUserById(userid=${user.userid})}">删除</a>
                <a th:href="@{/toUserEditPage(userid=${user.userid},username=${user.username},password=${user.password},money=${user.money})}">修改</a>
            </td>
        </tr>

    </table>
</div>


</body>
</html>